@home.main("Blast") {

    <div class="row">
        <div class="form-group col-sm-12">
            <h2 class="page-heading">Blast</h2>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-2">
            <div class="bs-docs-sidebar" role="complementary">
                <ul class="nav bs-docs-sidenav">
                    <li class="active"><a href="#blastn" data-toggle="tab">Blastn</a></li>
                    <li><a href="#blastp" data-toggle="tab">Blastp</a></li>
                    @* <li><a href="#blastx" data-toggle="tab">Blastx</a></li>*@

                </ul>
            </div>
        </div>

        <div class="col-sm-9 tab-content myform" >

            <div class="tab-pane active" id="blastn">
                <form class="form-horizontal" method="get" id="form">
                    <h4>Required:</h4>
                    <hr>

                    <input class="form-control" name="blastType" value="blastn" style="display: none;">

                    <div class="form-group">
                        <label class="control-label col-sm-3">Type of query:</label>
                        <div class="col-sm-4">
                            <select class="form-control" onchange="change(this, 'blastn')" name="method">
                                <option selected value="text">Text</option>
                                <option value="file">File</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group" id="blastnQueryContent">
                        <label class="control-label col-sm-3">Enter FASTA sequences:</label>
                        <div class="col-sm-8">
                            <textarea class="form-control monospace" name="queryText" id="queryText" rows="5"></textarea>
                            <span class="help-block">
                                e.g.,&nbsp;<a href="#" onclick="showExample('dna', 'form')"><em id="egQuery">
                                example</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="blastnQueryFile" style="display: none;">
                        <label class="control-label col-sm-3">upload file:</label>
                        <div class="col-sm-8">
                            <input id="input-1" type="file" class="file control-label" name="file" data-show-preview="false"
                            data-show-upload="false" accept=".fa,.fasta">
                            <span class="help-block"><a href="/eucalyptus/utils/downloadExample?example=blastn_example.fasta"><em id="egCrics">
                                Example_File</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="againstType">
                        <label class="control-label col-sm-3">Database:</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="db" id="db">
                                <option value="02428_cds.fasta">02428 Gene</option>
                                <option value="02428.genome">02428 Genome</option>
                                <option value="9311_cds.fasta">9311 Gene</option>
                                <option value="9311v2.genome">9311 Genome</option>
                                <option value="Basmati1_cds.fasta">Basmati1 Gene</option>
                                <option value="Basmati1.genome">Basmati1 Genome</option>
                                <option value="CJ14_cds.fasta">CJ14 Gene</option>
                                <option value="CJ14.genome">CJ14 Genome</option>
                                <option value="CN1B_cds.fasta">CN1B Gene</option>
                                <option value="CN1B.genome">CN1B Genome</option>
                                <option value="D62B_cds.fasta">D62B Gene</option>
                                <option value="D62B.genome">D62B Genome</option>
                                <option value="DG_cds.fasta">DG Gene</option>
                                <option value="DG.genome">DG Genome</option>
                                <option value="DHX2H_cds.fasta">DHX2H Gene</option>
                                <option value="DHX2H.genome">DHX2H Genome</option>
                                <option value="FH838_cds.fasta">FH838 Gene</option>
                                <option value="FH838.genome">FH838 Genome</option>
                                <option value="FS32_cds.fasta">FS32 Gene</option>
                                <option value="FS32.genome">FS32 Genome</option>
                                <option value="G46_cds.fasta">G46 Gene</option>
                                <option value="G46.genome">G46 Genome</option>
                                <option value="Guang8B_cds.fasta">Guang8B Gene</option>
                                <option value="Guang8B.genome">Guang8B Genome</option>
                                <option value="Gui630_cds.fasta">Gui630 Gene</option>
                                <option value="Gui630.genome">Gui630 Genome</option>
                                <option value="II32_cds.fasta"> Gene</option>
                                <option value="II32.genome">II32 Genome</option>
                                <option value="IR64_cds.fasta">IR64 Gene</option>
                                <option value="IR64.genome">IR64 Genome</option>
                                <option value="J4115S_cds.fasta">J4115S Gene</option>
                                <option value="J4115S.genome">J4115S Genome</option>
                                <option value="KY131_cds.fasta">KY131 Gene</option>
                                <option value="KY131.genome">KY131 Genome</option>
                                <option value="lemont_cds.fasta">lemont Gene</option>
                                <option value="lemont.genome">lemont Genome</option>
                                <option value="LJ_cds.fasta">LJ Gene</option>
                                <option value="LJ.genome">LJ Genome</option>
                                <option value="N22_cds.fasta">N22 Gene</option>
                                <option value="N22.genome">N22 Genome</option>
                                <option value="N22_cds.fasta">N22 Gene</option>
                                <option value="NAMROO.genome">NAMROO Genome</option>
                                <option value="NIP_cds.fasta">NIP Gene</option>
                                <option value="NIP.genome">NIP Genome</option>
                                <option value="R3551_cds.fasta">R3551 Gene</option>
                                <option value="R3551.genome">R3551 Genome</option>
                                <option value="R498_cds.fasta">R498 Gene</option>
                                <option value="R498.genome">R498 Genome</option>
                                <option value="R527_cds.fasta">R527 Gene</option>
                                <option value="R527.genome">R527 Genome</option>
                                <option value="R548_cds.fasta">R548 Gene</option>
                                <option value="R548.genome">R548 Genome</option>
                                <option value="TUMBA_cds.fasta">TUMBA Gene</option>
                                <option value="TUMBA.genome">TUMBA Genome</option>
                                <option value="WSSM_cds.fasta">WSSM Gene</option>
                                <option value="WSSM.genome">WSSM Genome</option>
                                <option value="Y58S_cds.fasta">Y58S Gene</option>
                                <option value="Y58Sv2.genome">Y58S Genome</option>
                                <option value="YueGuang_cds.fasta">YueGuang Gene</option>
                                <option value="YueGuang.genome">YueGuang Genome</option>
                                <option value="YX_cds.fasta">YX Gene</option>
                                <option value="YXv2.genome">YX Genome</option>
                                <option value="ZH11_cds.fasta">ZH11 Gene</option>
                                <option value="ZH11.genome">ZH11 Genome</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Evalue:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="evalue" id="evalue" value="1e-5">
                        </div>

                        <label class="control-label col-sm-3">Word size:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="wordSize" id="wordSize" value="28">
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Max target seqs:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="maxTargetSeqs" id="mCharacteristic" value="10">
                        </div>
                    </div>

                    <hr>
                    <div class="form-group">
                        <div class="actions col-sm-offset-3 col-sm-3">
                            <button type="button" class="btn btn-primary" style="width: 90%;" id="search"
                            onclick="blast('form')">
                                Search</button>
                        </div>
                        <div class="actions  col-sm-3">
                            <button type="reset" class="btn btn-primary" style="width: 90%;">
                                Reset</button>
                        </div>
                    </div>
                </form>
            </div>
                <!--Transcript -->
            <div class="tab-pane" id="blastp">
                <form class="form-horizontal" method="get" id="blastpForm">
                    <h4>Required:</h4>
                    <hr>

                    <input class="form-control" name="blastType" value="blastp" style="display: none;">


                    <div class="form-group">
                        <label class="control-label col-sm-3">Type of query:</label>
                        <div class="col-sm-4">
                            <select class="form-control" onchange="change(this, 'blastp')" name="method">
                                <option selected value="text">Text</option>
                                <option value="file">File</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group" id="blastpQueryContent" >
                        <label class="control-label col-sm-3">Enter FASTA sequences:</label>
                        <div class="col-sm-8">
                            <textarea class="form-control monospace" name="queryText" id="queryText" rows="5"></textarea>
                            <span class="help-block">
                                e.g.,&nbsp;<a href="#" onclick="showExample('protein', 'blastpForm')"><em id="egQuery">
                                example</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="blastpQueryFile" style="display: none;">
                        <label class="control-label col-sm-3">Upload file:</label>
                        <div class="col-sm-8">
                            <input id="input-1" type="file" class="file control-label" name="file" data-show-preview="false"
                            data-show-upload="false">
                            <span class="help-block"><a href="/eucalyptus/utils/downloadExample?example=blastp_example.fasta"><em>
                                Example file</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="againstType">
                        <label class="control-label col-sm-3">Database:</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="db" id="db">
                                <option value="02428_pep.fasta">02428 Gene</option>
                                <option value="9311_pep.fasta">9311 Gene</option>
                                <option value="Basmati1_pep.fasta">Basmati1 Gene</option>
                                <option value="CJ14_pep.fasta">CJ14 Gene</option>
                                <option value="CN1B_pep.fasta">CN1B Gene</option>
                                <option value="D62B_pep.fasta">D62B Gene</option>
                                <option value="DG_pep.fasta">DG Gene</option>
                                <option value="DHX2H_pep.fasta">DHX2H Gene</option>
                                <option value="FH838_pep.fasta">FH838 Gene</option>
                                <option value="FS32_pep.fasta">FS32 Gene</option>
                                <option value="G46_pep.fasta">G46 Gene</option>
                                <option value="Guang8B_pep.fasta">Guang8B Gene</option>
                                <option value="Gui630_pep.fasta">Gui630 Gene</option>
                                <option value="II32_pep.fasta">II32 Gene</option>
                                <option value="IR64_pep.fasta">IR64 Gene</option>
                                <option value="J4115S_pep.fasta">J4115S Gene</option>
                                <option value="KY131_pep.fasta">KY131 Gene</option>
                                <option value="lemont_pep.fasta">lemont Gene</option>
                                <option value="LJ_pep.fasta">LJ Gene</option>
                                <option value="N22_pep.fasta">N22 Gene</option>
                                <option value="NAMROO_pep.fasta">NAMROO Gene</option>
                                <option value="NIP_pep.fasta">NIP Gene</option>
                                <option value="R3551_pep.fasta">R3551 Gene</option>
                                <option value="R498_pep.fasta">R498 Gene</option>
                                <option value="R527_pep.fasta">R527 Gene</option>
                                <option value="R548_pep.fasta">R548 Gene</option>
                                <option value="TUMBA_pep.fasta">TUMBA Gene</option>
                                <option value="WSSM_pep.fasta">WSSM Gene</option>
                                <option value="Y58S_pep.fasta">Y58S Gene</option>
                                <option value="YueGuang_pep.fasta">YueGuang Gene</option>
                                <option value="YX_pep.fasta">YX Gene</option>
                                <option value="ZH11_pep.fasta">ZH11 Gene</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Evalue:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="evalue" id="evalue" value="1e-5">
                        </div>

                        <label class="control-label col-sm-3">Word size:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="wordSize" id="wordSize" value="3">
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Max target seqs:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="maxTargetSeqs" id="mCharacteristic" value="10">
                        </div>
                    </div>

                    <hr>
                    <div class="form-group">
                        <div class="actions col-sm-offset-3 col-sm-3">
                            <button type="button" class="btn btn-primary" style="width: 90%;" id="search"
                            onclick="blast('blastpForm')">
                                Search</button>
                        </div>
                        <div class="actions  col-sm-3">
                            <button type="reset" class="btn btn-primary" style="width: 90%;">
                                Reset</button>
                        </div>
                    </div>
                </form>
            </div>

            <div class="tab-pane" id="blastx">
                <form class="form-horizontal" method="get" id="blastxForm">
                    <h4>Required:</h4>
                    <hr>

                    <input class="form-control" name="blastType" value="blastx" style="display: none;">

                    <div class="form-group">
                        <label class="control-label col-sm-3">Type of query:</label>
                        <div class="col-sm-4">
                            <select class="form-control" onchange="change(this, 'blastx')" name="method">
                                <option selected value="text">Text</option>
                                <option value="file">File</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group" id="blastxQueryContent" >
                        <label class="control-label col-sm-3">Enter FASTA sequences:</label>
                        <div class="col-sm-8">
                            <textarea class="form-control monospace" name="queryText" id="queryText" rows="5"></textarea>
                            <span class="help-block">
                                e.g.,&nbsp;<a href="#" onclick="showExample('dna', 'blastxForm')"><em id="egQuery">
                                example</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="blastxQueryFile" style="display: none;">
                        <label class="control-label col-sm-3">Upload file:</label>
                        <div class="col-sm-8">
                            <input id="input-1" type="file" class="file control-label" name="file" data-show-preview="false"
                            data-show-upload="false">
                            <span class="help-block"><a href="/eucalyptus/utils/downloadExample?example=blastx_example.fasta"><em>
                                Example file</em></a></span>
                        </div>
                    </div>

                    <div class="form-group" id="againstType">
                        <label class="control-label col-sm-3">Database:</label>
                        <div class="col-sm-4">
                            <select class="form-control" name="db" id="db">
                                <option selected value="Basmati1.IGDBv1.Allset.pros.long.fasta">Basmati1</option>
                                <option value="CJ14.IGDBv1.Allset.pros.long.fasta">CJ14</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Evalue:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="evalue" id="evalue" value="1e-5">
                        </div>

                        <label class="control-label col-sm-3">Word size:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="wordSize" id="wordSize" value="3">
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-3">Max target seqs:</label>
                        <div class="col-sm-2">
                            <input class="form-control" name="maxTargetSeqs" id="mCharacteristic" value="10">
                        </div>
                    </div>

                    <hr>
                    <div class="form-group">
                        <div class="actions col-sm-offset-3 col-sm-3">
                            <button type="button" class="btn btn-primary" style="width: 90%;" id="search"
                            onclick="blast('blastxForm')">
                                Search</button>
                        </div>
                        <div class="actions  col-sm-3">
                            <button type="reset" class="btn btn-primary" style="width: 90%;">
                                Reset</button>
                        </div>
                    </div>
                </form>
            </div>

        </div>
    </div>

    <div id="result" style="display: none">
        <hr>
        <h4 style="color: black">Result:</h4>
        <button class="btn btn-primary down" onclick="downloadExcel()">Download</button>
        <iframe id="frame" style="width: 1200px;" height="1000px" frameborder="0" align="middle">

        </iframe>

    </div>

    <script>

            var excel = "";


            var dna = ">example1\n" +
                    "ATGGGTGTGCAGCAACTGGGAGGCGCCGGCGGCGGGCGCGGGGGCGGCCGGCGGAGCCGCCGAGGTCGCCGTGAGGCACCACCGCGCCTTGCCCACCGGT" +
                    "GCGCCGACGAAGGACTCCGGGCTCCTCTCCGCGTGGATGCAATCAAGGGAAGCCACAGTACAGTCTCCTGTATGGCGCAGGTGCGAGCATGGAATACACC" +
                    "CATTTGGTGA\n" +
                    ">example2\n" +
                    "ATGCAGCGGCGGCGGGGCCTCGCCGCGCTCGCCGTCCTCCTCGCCCTCGCGGCGCGCGGCGCGGACGCGTCCGTCCACGAGTACTCGGGCGGGGGGTTCG" +
                    "CGCCGCGGGCCAACTCCTTCTTCTTCCACGGCGGCAGCGAGGGGCTGTACGCCTCCGACCCCACCTCCAACTCCTCCGCCTCCTTCATCAGGTTTGACTC" +
                    "TGTCACATTTCGACGGACCCAGGAGTCAGCAGGTAGGCATGAGGCTATGCAGCAAAAGACAGGGTTAGTTGAGGCTATTATTGTTGAGATCCAGGACAGA" +
                    "AGCAAGATTGGTGGTTCTTACTTGCATTCTGATGCAATATGCTGCACTCCTGAGCTCGATAAAGAGAAGTCCTGCAAAGTTGGTGAAGTAATTATACAGC" +
                    "CAAATCCTGATAATCCTGACTGGCCAAAAAGGGTTCAGACATTTTTTAGTGGTAGAGATGAAGAAGCTAGCATGGTCACACAAGTTGTATCTATAAACAA" +
                    "AACAGGGATGTACTACCTCTATTTTATGTTCTGTGATCCACAGCTCAAGGGATTGAAGATTACAGGCAGGACTGTTTGGCGAAACCCACAAGGTTATCTC" +
                    "CCTGGTAAAATGGCCCCAATGATGACATTTTATGGTTTCATGTCGCTTGCATATCTTGTACTTGGACTTCTGTGGTTTCTTCAGTTTGTGCGATGCTGGA" +
                    "AGGATATTTTGCAGCTGCACTACCATATAACAGCTGTTATTGCTCTTGGCATGTGCGAGATGGCTTTCTGGTACTTTGAGTATGCTAACTTCAATTCGAC" +
                    "TGGAAACAGACCTATGGCTATAACCTTGTGGGCAGTTACATTTACTGCTGTGAAGAAGACCATATCTCGCCTTCTTTTATTAGTGGTTTCTATGGGATAT" +
                    "GGTGTTGTTAGACCCACATTAGGTGGGGTTACATCTAAAGTAGGTGCTCTTGGTGTCGTCTATTTTATTGCTTCGGAAGGTCTTGAACTTGTTGAAAATC" +
                    "TTGGAAACATCAATGACTTCTCTGGGAAAACAAGGTTATTTCTGGTGTTACCTGTTGCCATACTTGATGCTACCTTCATTATCTGGATATTTTCATCGCT" +
                    "CTCGAGAACTTTGGAGAAGCTCCAGCTGCGGAGAAGTATGGCAAAACTTGAATTGTATCGGAAGTTTACAAATTCTCTAGCTTTGTCAGTTCTTATCTCT" +
                    "ATTGCTTGGATTGGCTATGAGGTATGA\n";
            var pro = ">example1\n" +
                    "MAASPPWANLVSAVVGEIANHLPCEFDRVHFAAVCRSWRASLEQQAPVPLPPALPVLILPLAERPAVSFVLSNCAIHPAVLPEWPHDARYIGAYDDGWSS" +
                    "SPLLHLEVLESTASSTPKTPALTSTSPPSSSRSRTERPGRNGSCRSPSSPPPSRPNQTSTDASSPASSALTPSPGASGRLGSGAPPIG\n" +
                    ">example2\n" +
                    "MAELCIQGLWTHEPPLYFQACGWDAPSAMQEAALQAIVYYRHYRPGLDGFFHFFPARANQSSANYYPGLEGNMREIDTPGLFLAGLVRAMDRYLAKTITE" +
                    "LRRLQARVVMLDRRIEPLGHQGHFDNAIIYGNHELQPLTETLPPPMGIYHNINTRARMRVGFHRNRRTMPDPALAGDPVLLGPFYEFERNGRQYRLTMAT" +
                    "PSTTVPQPPIGFSEVP\n";

            $(function () {

                formValidation()
            });


            function change(element, t) {
                var value = $(element).find(">option:selected").val();
                if (value == "text") {
                    $(".fileinput-remove-button").click();
                    $("#" + t + "QueryContent").show();
                    $("#" + t + "QueryFile").hide()
                } else {
                    $(".blast-text").val("");
                    $("#" + t + "QueryContent").hide();
                    $("#" + t + "QueryFile").show()
                }
            }

            function downloadExcel() {
                var fileName = "blast.xls";
                var content = excel;
                var blob = new Blob([content], {
                    type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8"
                });
                saveAs(blob, fileName)
            }

            function showExample(type, formId) {
                var seq = "";

                if (type == "protein") {
                    seq = pro;
                } else {
                    seq = dna;
                }

                $("#" + formId + " #queryText").val(seq);
                $("#" + formId).formValidation("revalidateField", "queryText")
            }

            function inputCheck(formId) {
                var file = $("#" + formId + " #queryText").val();
                var text = $("#" + formId + " #input-1").val();
                var b = true;
                if (!file && !text) {
                    b = false;
                    swal("Error", "If you don't upload  sequences as a file, please paste sequences!", "error")
                } else if (file && text) {
                    b = false;
                    swal("Error", "Please either enter sequences into the box or upload a file, not both!", "error")
                }
                return b
            }

            function blast(formId) {
                var form = $("#" + formId)
                var fv = form.data("formValidation");
                fv.validate();
                if (fv.isValid() && inputCheck(formId)) {
                    var form1 = new FormData($("#" + formId)[0]);
                    var element = "<div id='content'><span id='info'>Query...</span>&nbsp;<img class='runningImage' src='/assets/images/running2.gif' style='width: 30px;height: 20px;'></div>"
                    var index = layer.alert(element, {
                        skin: 'layui-layer-molv'
                        , closeBtn: 0,
                        title: "Info",
                        btn: []
                    });
                    $.ajax({
                        url: "@routes.ToolsController.blastRun()",
                        type: "post",
                        processData: false,
                        contentType: false,
                        data: form1,
                        success: function (data) {
                            layer.close(index);
                            if (data.valid == "false") {
                                swal("Error", data.message, "error");
                                $("#result").hide()
                            } else {
                                $("#frame").attr("src", "/RiceRC/tools/blastResultBefore?path=" + data.html);
                                excel = data.excel;
                                $("#result").show()
                            }
                        }
                    });
                }
            }

            function formValidation() {
                var infinityNumber = Number.MAX_VALUE;
                $('#form').formValidation({
                    framework: 'bootstrap',
                    icon: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        file: {
                            validators: {
                                file: {
                                    extension: 'fa,fasta',
                                    message: 'Query file must is a fasta file！'
                                }
                            }
                        },
                        evalue: {
                            validators: {
                                notEmpty: {
                                    message: 'Evalue is required！'
                                },
                                numeric: {
                                    message: 'Evalue must be number！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Evalue must greater than or equal to 0！"
                                }
                            }
                        },
                        wordSize: {
                            validators: {
                                notEmpty: {
                                    message: 'Word size is required！'
                                },
                                integer: {
                                    message: 'Word size must be intger！'
                                },
                                between: {
                                    min: "4",
                                    max: infinityNumber,
                                    message: "Word size must greater than or equal to 4！"
                                }
                            }
                        },
                        maxTargetSeqs: {
                            validators: {
                                notEmpty: {
                                    message: 'Max target seqs is required！'
                                },
                                integer: {
                                    message: 'Max target seqs must be integer！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Max target seqs must greater than or equal to 0！"
                                }
                            }
                        }
                    }
                });

                $('#blastpForm').formValidation({
                    framework: 'bootstrap',
                    icon: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        file: {
                            validators: {
                                file: {
                                    extension: 'fa,fasta',
                                    message: 'Query file must is a fasta file！'
                                }
                            }
                        },
                        evalue: {
                            validators: {
                                notEmpty: {
                                    message: 'Evalue is required！'
                                },
                                numeric: {
                                    message: 'Evalue must be number！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Evalue must greater than or equal to 0！"
                                }
                            }
                        },
                        wordSize: {
                            validators: {
                                notEmpty: {
                                    message: 'Word size is required！'
                                },
                                integer: {
                                    message: 'Word size must be intger！'
                                },
                                between: {
                                    min: "0",
                                    max: 8,
                                    inclusive: false,
                                    message: "Word size must less than  8！"
                                }
                            }
                        },
                        maxTargetSeqs: {
                            validators: {
                                notEmpty: {
                                    message: 'Max target seqs is required！'
                                },
                                integer: {
                                    message: 'Max target seqs must be integer！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Max target seqs must greater than or equal to 0！"
                                }
                            }
                        }
                    }
                });

                $('#blastxForm').formValidation({
                    framework: 'bootstrap',
                    icon: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        file: {
                            validators: {
                                file: {
                                    extension: 'fa,fasta',
                                    message: 'Query file must is a fasta file！'
                                }
                            }
                        },
                        evalue: {
                            validators: {
                                notEmpty: {
                                    message: 'Evalue is required！'
                                },
                                numeric: {
                                    message: 'Evalue must be number！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Evalue must greater than or equal to 0！"
                                }
                            }
                        },
                        wordSize: {
                            validators: {
                                notEmpty: {
                                    message: 'Word size is required！'
                                },
                                integer: {
                                    message: 'Word size must be intger！'
                                },
                                between: {
                                    min: "0",
                                    max: 8,
                                    inclusive: false,
                                    message: "Word size must less than  8！"
                                }
                            }
                        },
                        maxTargetSeqs: {
                            validators: {
                                notEmpty: {
                                    message: 'Max target seqs is required！'
                                },
                                integer: {
                                    message: 'Max target seqs must be integer！'
                                },
                                between: {
                                    min: "0",
                                    max: infinityNumber,
                                    message: "Max target seqs must greater than or equal to 0！"
                                }
                            }
                        }
                    }
                });
            }

            $("#input-1").fileinput({
                showPreview: false
            });

    </script>


}